<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>{$pagetitle}</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="stylesheet" href="/static/admin/layui/css/layui.css" media="all">
  <link rel="stylesheet" href="/static/admin/style/global.css" media="all">
</head>
<body>


  <form class="layui-form" action="{:url()}" method="post" style="padding-top: 10px;" onsubmit="return save_form(this,success_fun)" style="padding-top: 10px;">
	<input type="hidden" name="catid" value="{$cat.catid}">
	<input type="hidden" name="ids" value="{$Request.param.ids}">
    <div class="layui-form-item">
      <label class="layui-form-label">数据源</label>
		<div class="layui-input-block">
		  <input type="radio" name="export_type" value="check" title="勾选的信息" checked>
		  <input type="radio" name="export_type" value="all" title="当前栏目所有信息">
		</div>
    </div>

    <div class="layui-form-item">
      <label class="layui-form-label">要导出的字段</label>
		<div class="layui-input-block">
			{foreach $modelAllField as $v}
				<input type="checkbox" name="export_field[]" value="{$v.field}" title="{$v.name}" checked>
			{/foreach}
		</div>
    </div>	

	<div class="layui-form-item" style="margin-top:100px;">
		<div class="layui-input-block">
		  <button class="layui-btn" type="submit">开始导出</button>
		  <button type="reset" class="layui-btn layui-btn-primary close">关闭</button>
		</div>
	</div>
  </div>
	</form>
	
<div class="layui-card-body">
	<table class="layui-table export_result"></table>	
</div>
	
  <script src="/static/admin/layui/layui.js"></script>
  <script src="/static/js/jquery.min.js"></script>    
  <script src="/static/js/globals.js"></script>  
  <script>
  layui.config({
    base: '/static/admin/' //静态资源所在路径
  }).extend({
    index: 'lib/index' //主入口模块
  }).use(['index', 'form'], function(){
    var $ = layui.$
    ,admin = layui.admin
    ,element = layui.element
	,form = layui.form;

  }); 
	//导入成功后的回调
	function success_fun(url){
		console.log(url);
		layer.msg("数据已导出，请保存文件");
        window.open(url);
	}
  </script>
</body>
</html>